home *** CD-ROM | disk | FTP | other *** search
- property iSprNum, iHomeLocH, iHomeLocV, iExpandSpeed, iBarHeight, iNumofBars, iColHeight, iFullCast, iBarWidth, iDefaultBar, iReturnList, iHLTop, iHLLeft
- global gFlashPixel, gHltPixel, gGlobalStepCount, gPixelHold, gExtraSpeed, gPopupSND, gTbarSND, oIndexScroller
-
- on birth me, thespr, barHt, numofBars, widthofBar, castmem, DefaultBar, speed, pRetLst
- set iSprNum to thespr
- set iDefaultBar to DefaultBar
- set iBarHeight to barHt + 0.0
- set iNumofBars to numofBars
- set iBarWidth to widthofBar
- set iColHeight to iBarHeight * iNumofBars
- set iFullCast to castmem
- set iHomeLocH to the locH of sprite iSprNum
- set iHomeLocV to the locV of sprite iSprNum
- set iExpandSpeed to speed + gExtraSpeed
- set iReturnList to pRetLst
- sort(iReturnList)
- return me
- end
-
- on mUnfold me
- hearit(gPopupSND)
- set the castNum of sprite iSprNum to iFullCast
- set the stretch of sprite iSprNum to 1
- set the width of sprite iSprNum to iBarWidth
- set i to iBarHeight
- repeat while i < iColHeight
- set the height of sprite iSprNum to i
- updateStage()
- set i to i + iExpandSpeed
- end repeat
- set the stretch of sprite iSprNum to 0
- updateStage()
- set the castNum of sprite iSprNum to iFullCast
- end
-
- on mDumpParams me
- end
-
- on mSwitchCast me, whereHor, whereVer, vwhom
- puppetSprite(gHltPixel, 1)
- set the locH of sprite gHltPixel to whereHor
- set the locV of sprite gHltPixel to whereVer
- set the castNum of sprite gHltPixel to vwhom
- updateStage()
- end
-
- on mRollOver me
- repeat while the stillDown
- if the mouseCast = iFullCast then
- set vMousePos to the mouseV
- set vRelativeClick to vMousePos - the top of sprite iSprNum
- set vWhere to integer((vRelativeClick / iBarHeight) + 0.4999999)
- if vWhere < 1 then
- set vWhere to 1
- end if
- set whereHor to the left of sprite iSprNum
- set whereVer to the top of sprite iSprNum + ((vWhere - 1) * iBarHeight)
- set vwhom to iFullCast + vWhere
- mSwitchCast(me, whereHor, whereVer, vwhom)
- next repeat
- end if
- if (the mouseCast > (iFullCast + iNumofBars)) or (the mouseCast < iFullCast) then
- mSwitchCast(me, whereHor, whereVer, gPixelHold)
- end if
- end repeat
- mSwitchCast(me, whereHor, whereVer, gPixelHold)
- if (the mouseCast = iFullCast) and (vwhom > 0) then
- set iDefaultBar to vwhom + iNumofBars
- mPlaceaBar(me, iDefaultBar)
- updateStage()
- mUpdateChroIndex(oIndexScroller, getAt(iReturnList, vWhere))
- else
- mPlaceaBar(me, iDefaultBar)
- end if
- end
-
- on mPlaceaBar me, whatbarnum
- hearit(gTbarSND)
- puppetSprite(iSprNum, 1)
- set the castNum of sprite iSprNum to whatbarnum
- updateStage()
- end
-
- on mLeaveMode me
- set the stretch of sprite iSprNum to 0
- puppetSprite(iSprNum, 0)
- puppetSprite(gHltPixel, 0)
- updateStage()
- end
-
- on mHltfromScripts me
- puppetSprite(iSprNum, 1)
- set Lwhereat to the iPagePointer of oIndexScroller
- if Lwhereat = 1 then
- set whatnum to 1
- else
- set whatnum to getPos(iReturnList, Lwhereat)
- if whatnum = 0 then
- set whatnum to findPosNear(iReturnList, Lwhereat)
- end if
- end if
- set whatnum to iNumofBars + iFullCast + whatnum
- set the castNum of sprite iSprNum to whatnum
- updateStage()
- end
-